{
    "query": {
        "match": {
            "text": "{{my_value}}"
        }
    },
    "aggs": {
        "my_terms": {
            "terms": { "field": "{{my_field}}" }
        }
    }
}
